package my.study.c.consul.consumer.app.hello.service;

import feign.RequestLine;
import my.study.c.consul.consumer.app.configuration.FeignConfiguration;
import my.study.c.consul.provider.api.app.hello.entity.Blog;
import my.study.c.consul.provider.api.app.hello.vo.BlogVO;
import my.study.common.util.PageParams;
import my.study.common.util.PageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

@FeignClient(contextId = "blogFeign", name = "service-provider", configuration = FeignConfiguration.class)
public interface BlogFeign {

    //@RequestLine("POST /hello/blog")
    @PostMapping("/hello/blog")
    PageResult<Blog> list(PageParams<BlogVO> pageParams);

    @GetMapping("/hello/blog/get")
    List<Blog> get(@SpringQueryMap BlogVO vo);
}
